package com.wanger.swa.config.swTools;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.wanger.swa.dto.template.resp.tips.systemTool.SysToolInfo;
import com.wanger.swc.model.tips.TipInfo;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: wanger
 * @Date: 2024/12/29 18:21
 * @Description:
 */
@Data
@Component
public class DateUtilResp implements SysToolInfo {

    @Override
    public Class<?> toolType() {
        return DateUtil.class;
    }

    @Override
    public TipInfo getTitle() {
        return new TipInfo("DateUtil", "时间工具，参考hutool=>DateUtil");
    }

    @Override
    public List<TipInfo> getTips() {
        return CollUtil.toList(
                new TipInfo("DateUtil.now()", "常用格式【yyyy-MM-dd HH:mm:ss】"),
                new TipInfo("DateUtil.today()", "常用格式【yyyy-MM-dd】"),
                new TipInfo("DateUtil.format(DateUtil.date(), \"HH:mm\")", "自定义格式"),
                new TipInfo("other", "其他功能参考hutool->DateUtil")
        );
    }
}
